﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using Equation.Enterprise.Framework.Web.Model;

using ENail.Domain.Core;
using ENail.Domain.Core.Contract.Services;
using ENail.ApplicationServices;
using ENail.Portal.Web.Models;


namespace ENail.Portal.Web.Controllers
{
    public class TaskController : BaseController
    {
        private ITaskService _service;
        private ListViewModelMapper<TaskListViewItem, Task> _listMapper;
        public static GenericListViewModel<TaskListViewItem> viewModel;

        public TaskController(ITaskService service)
        {
            _service = service;
            _listMapper = new TaskListViewModelMapper();
            List<Task> domainModel = _service.GetTask(System.DateTime.Now, System.DateTime.Now).ToList();
            GenericListViewModel<TaskListViewItem> viewModel = new GenericListViewModel<TaskListViewItem>();
            _listMapper.MapDomainToView(domainModel, viewModel);

        }
        //public ActionResult Index()
        //{
        //    List<Task> domainModel = _service.GetTask(System.DateTime.Now, System.DateTime.Now).ToList();
        //    GenericListViewModel<TaskListViewItem> viewModel=new GenericListViewModel<TaskListViewItem>();
        //    _listMapper.MapDomainToView(domainModel,viewModel);
        //    return View("TaskList", viewModel);
        //}

        //public GenericListViewModel<TaskListViewItem> TaskModel
        //{
        //    get { return viewModel; }  
        //}
    }
}
